<!-- 户型配套popup -->
<template>
  <view class="view-more-popup">
    <uv-popup ref="popup" round="20">
      <view class="popup-container">
        <view class="popup-header">
          <view class="left"></view>
          <p class="center">{{ title }}</p>
          <view class="right">
            <uv-icon class="right" name="close" @click="popupClose"></uv-icon>
          </view>
        </view>
        <view class="popup-main">
          <view class="supports-list">
            <view class="supports-item" v-for="(item, index) in list" :key="index">
              <image :src="item.icon" />
              <view class="title">{{ item.title }}</view>
            </view>
          </view>
          <view class="content">{{ content }}</view>
        </view>
        <view class="button-wrap">
          <view class="button cancel" @click="popupClose">我知道了</view>
        </view>
      </view>
    </uv-popup>
  </view>
</template>

<script>
import { mapActions, mapGetters } from 'vuex'

export default {
  name: 'componentName',
  components: {},
  mixins: [],
  props: {},
  data() {
    return {
      title: '',
      list: [],
      content: '',
    }
  },
  // 侦听属性
  watch: {},
  // 计算属性
  computed: {
    ...mapGetters([]),
  },
  // 监听页面加载，该钩子被调用时data,computed,function,watch,props,slots已设置完成
  onLoad(options) {},
  // 监听页面显示，页面每次出现在屏幕上都触发
  onShow() {},
  // 监听页面初次渲染完成，此时组件已挂载完成
  onReady() {},
  // 下拉刷新
  onPullDownRefresh() {},
  // 加载更多
  onReachBottom() {},

  created() {},
  mounted() {},
  destroyed() {},
  methods: {
    ...mapActions([]),
    open({ title, list, content }) {
      this.title = title
      this.list = list
      this.content = content
      this.$refs.popup.open('bottom')
    },
    popupClose() {
      this.title = ''
      this.list = []
      this.content = ''
      this.$refs.popup.close()
    },
  },
}
</script>

<style lang="scss" scoped>
.popup-container {
  width: 100%;
  min-height: 400rpx;
  max-height: 1000rpx;
  box-sizing: border-box;
  padding: 24rpx 32rpx 140rpx;
  .popup-header {
    display: flex;
    justify-content: space-between;
    padding: 20rpx 0 40rpx;
    .left {
      width: 32rpx;
      visibility: hidden;
    }
    .center {
      font-weight: bold;
      font-size: 16px;
      color: #333333;
      line-height: 16px;
    }
    .right {
      image {
        width: 50rpx;
        height: 50rpx;
      }
    }
  }
  .popup-main {
    overflow-y: scroll;
    max-height: 740rpx;
    min-height: 550rpx;
    .supports-list {
      width: 100%;
      display: flex;
      flex-wrap: wrap;
      .supports-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 20%;
        margin-bottom: 46rpx;
        image {
          width: 48rpx;
          height: 48rpx;
          margin-bottom: 12rpx;
        }
        .title {
          font-size: 24rpx;
          font-weight: 400;
          color: #222222;
          line-height: 34rpx;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
      }
    }
  }
  .button-wrap {
    display: flex;
    justify-content: space-between;
    width: 100%;
    position: fixed;
    left: 0;
    bottom: 0;
    width: calc(100% - 32px);
    padding: 0 32rpx 32rpx;
    .button {
      font-weight: 400;
      font-size: 28rpx;
      padding: 24rpx 0;
      border-radius: 200rpx;
      text-align: center;
      width: 100%;
      font-size: 28rpx;
      font-weight: bold;
      color: #ffffff;
      background: $uv-primary;
    }
  }
}
</style>
